<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

//后台
Route::group(function (){
    //首页
    Route::group(function (){
        Route::rule('admin/home','admin.Home/index');
        
        //获取模板对应的首页自动加载数据
        Route::rule('admin/getTemplateHomeData','admin.miniapp.template/getHomeData');
    });

    //会员管理
    Route::group(function (){
        Route::rule('admin/getMemberList','admin.Member/index');
        Route::rule('admin/showMember','admin.Member/show');
        Route::rule('admin/saveMember','admin.Member/save');
        Route::rule('admin/saveNickName','admin.Member/saveNickName');
        Route::rule('admin/exportMember','admin.Member/export');

        Route::rule('admin/getMemberDetail','admin.Member/detail');
        Route::rule('admin/assignAdviser','admin.Member/assignAdviser');
        Route::rule('admin/balanceRecharge','admin.Member/balanceRecharge');
        Route::rule('admin/balanceDeduction','admin.Member/balanceDeduction');
        Route::rule('admin/integralRecharge','admin.Member/integralRecharge');
        Route::rule('admin/integralDeduction','admin.Member/integralDeduction');
        Route::rule('admin/sendCoupon','admin.Member/sendCoupon');

        Route::rule('admin/getMemberCouponList','admin.member.Coupon/index');
        Route::rule('admin/getMemberCouponLogsList','admin.logs.Member/coupon');
        Route::rule('admin/writeOffCoupon','admin.Member/writeOffCoupon');

        Route::rule('admin/getMemberBalanceLogsList','admin.logs.Member/balance');
        Route::rule('admin/getMemberIntegralLogsList','admin.logs.Member/integral');
        Route::rule('admin/getMemberBuyLogsList','admin.logs.Member/buy');

        //线下补单
        Route::rule('admin/getSupplementList','admin.member.Supplement/index');
        Route::rule('admin/getMemberWithMobileFromSupplement','admin.member.Supplement/getMemberWithMobileFromSupplement');
        Route::rule('admin/saveSupplement','admin.member.Supplement/save');
        //办理次卡
        Route::rule('admin/chooseOnceCard','admin.project.Oncecard/chooseOnceCard');
        Route::rule('admin/applyOnceCard','admin.project.Oncecard/applyOnceCard');
    });

    //卡项管理
    Route::group(function (){
        //项目分类管理
        Route::rule('admin/getProjectTypeList','admin.project.Project/getProjectTypeList');
        Route::rule('admin/showProjectType','admin.project.Project/showProjectType');
        Route::rule('admin/saveProjectType','admin.project.Project/saveProjectType');
        Route::rule('admin/delProjectType','admin.project.Project/delProjectType');
        
        //项目管理
        Route::rule('admin/getProjectList','admin.project.Project/index');
        Route::rule('admin/showProject','admin.project.Project/show');
        Route::rule('admin/saveProject','admin.project.Project/save');
        Route::rule('admin/delProject','admin.project.Project/del');

        //抢购管理
        Route::rule('admin/getSnapupList','admin.project.Snapup/index');
        Route::rule('admin/showSnapup','admin.project.Snapup/show');
        Route::rule('admin/chooseProjectFromSnapup','admin.project.Snapup/chooseProject');
        Route::rule('admin/saveSnapup','admin.project.Snapup/save');
        Route::rule('admin/undercarriageSnapup','admin.project.Snapup/undercarriage');
        Route::rule('admin/groundingSnapup','admin.project.Snapup/grounding');
        Route::rule('admin/delSnapup','admin.project.Snapup/del');

        //次卡管理
        Route::rule('admin/getOncecardList','admin.project.Oncecard/index');
        Route::rule('admin/showOncecard','admin.project.Oncecard/show');
        Route::rule('admin/getProjectByIdsFromOncecard','admin.project.Oncecard/getProjectByIdsFromOncecard');
        Route::rule('admin/getProjectFromOncecard','admin.project.Oncecard/getProjectFromOncecard');
        Route::rule('admin/saveOncecard','admin.project.Oncecard/save');
        Route::rule('admin/undercarriageOncecard','admin.project.Oncecard/undercarriage');
        Route::rule('admin/groundingOncecard','admin.project.Oncecard/grounding');
        Route::rule('admin/delOncecard','admin.project.Oncecard/del');

        //抢购订单管理
        Route::rule('admin/getSnapupOrderList','admin.project.SnapupOrder/index');
        Route::rule('admin/getSnapupOrderDetail','admin.project.SnapupOrder/detail');
        Route::rule('admin/writeOffSnapupOrder','admin.project.SnapupOrder/writeOff');
        Route::rule('admin/getMemberSnapUpList','admin.project.SnapupOrder/getMemberSnapUpList');
        Route::rule('admin/getMemberSnapUpLogs','admin.project.SnapupOrder/getMemberSnapUpLogs');

        //次卡订单管理
        Route::rule('admin/getOncecardOrderList','admin.project.OncecardOrder/index');
        Route::rule('admin/getMemberOnceCardList','admin.project.OncecardOrder/getMemberOnceCardList');
        Route::rule('admin/getOncecardOrderDetail','admin.project.OncecardOrder/detail');
        Route::rule('admin/writeOffOncecardOrder','admin.project.OncecardOrder/writeOff');
        Route::rule('admin/getMemberOnceCardLogs','admin.project.OncecardOrder/getMemberOnceCardLogs');
    });

    //预约排版
    Route::group(function (){
        //岗位管理
        Route::rule('admin/getPosition','admin.appointment.Position/index');
        Route::rule('admin/savePosition','admin.appointment.Position/save');
        Route::rule('admin/delPosition','admin.appointment.Position/del');
        //提成方案
        Route::rule('admin/getCommission','admin.appointment.Commission/index');
        Route::rule('admin/saveCommission','admin.appointment.Commission/save');
        Route::rule('admin/delCommission','admin.appointment.Commission/del');

        //技师管理
        Route::rule('admin/getTechnicianList','admin.appointment.Technician/index');
        Route::rule('admin/showTechnician','admin.appointment.Technician/show');
        Route::rule('admin/saveTechnician','admin.appointment.Technician/save');
        Route::rule('admin/quitTechnician','admin.appointment.Technician/quit');
        Route::rule('admin/delTechnician','admin.appointment.Technician/del');
        Route::rule('admin/getTechnicianDetail','admin.appointment.Technician/detail');
        Route::rule('admin/changTagsFromTechnicianDetail','admin.appointment.Technician/changTags');
        Route::rule('admin/getTechnicianAppointmentList','admin.appointment.Technician/getTechnicianAppointmentList');
        Route::rule('admin/getTechnicianBindProjectList','admin.appointment.Technician/getTechnicianBindProjectList');
        Route::rule('admin/getProjectListFromTechnicianBind','admin.appointment.Technician/getProjectListFromTechnicianBind');
        Route::rule('admin/technicianBindProject','admin.appointment.Technician/technicianBindProject');
        Route::rule('admin/delTechnicianProject','admin.appointment.Technician/delTechnicianProject');

        //预约列表
        Route::rule('admin/getAppointmentList','admin.appointment.Appointment/index');
        Route::rule('admin/chooseProjectFromAppointment','admin.appointment.Appointment/chooseProject');
        Route::rule('admin/chooseTechnicianFromAppointment','admin.appointment.Appointment/chooseTechnician');
        Route::rule('admin/saveAppointment','admin.appointment.Appointment/save');
        Route::rule('admin/sureAppointment','admin.appointment.Appointment/sure');
        Route::rule('admin/cancelAppointment','admin.appointment.Appointment/cancel');
        Route::rule('admin/arrivalAppointment','admin.appointment.Appointment/arrival');

        //预约看板
        Route::rule('admin/showAppointmentKanban','admin.appointment.Kanban/show');

        //预约设置
        Route::rule('admin/showAppointmentSetting','admin.appointment.Setting/show');
        Route::rule('admin/saveAppointmentSetting','admin.appointment.Setting/save');

        //技师排班
        Route::rule('admin/showTechnicianScheduling','admin.appointment.Scheduling/show');
        Route::rule('admin/showTechnicianFromScheduling','admin.appointment.Scheduling/showTechnicianFromScheduling');
        Route::rule('admin/getProjectFromScheduling','admin.appointment.Scheduling/getProjectFromScheduling');
        Route::rule('admin/saveTechnicianScheduling','admin.appointment.Scheduling/save');
        Route::rule('admin/delTechnicianScheduling','admin.appointment.Scheduling/del');

        //业绩类型
        Route::rule('admin/getPerformanceTypeList','admin.appointment.PerformanceType/index');
        Route::rule('admin/showPerformanceType','admin.appointment.PerformanceType/show');
        Route::rule('admin/savePerformanceType','admin.appointment.PerformanceType/save');
        Route::rule('admin/delPerformanceType','admin.appointment.PerformanceType/del');

        //业绩核准
        Route::rule('admin/getPerformanceList','admin.appointment.Performance/index');
        Route::rule('admin/approvalPerformance','admin.appointment.Performance/approval');

        //员工业绩
        Route::rule('admin/getEmployeePerformanceList','admin.appointment.EmployeePerformance/index');
        Route::rule('admin/getEmployeePerformanceDetail','admin.appointment.EmployeePerformance/getEmployeePerformanceDetail');
    });

    //会员等级管理
    Route::group(function (){
        Route::rule('admin/getLevelList','admin.Level/index');
        Route::rule('admin/showLevel','admin.Level/show');
        Route::rule('admin/saveLevel','admin.Level/save');
        Route::rule('admin/delLevel','admin.Level/del');
    });

    //优惠卷
    Route::group(function (){
        Route::rule('admin/getCouponList','admin.Coupon/index');
        Route::rule('admin/showCoupon','admin.Coupon/show');
        Route::rule('admin/saveCoupon','admin.Coupon/save');
        Route::rule('admin/undercarriageCoupon','admin.Coupon/undercarriage');
        Route::rule('admin/groundingCoupon','admin.Coupon/grounding');
        Route::rule('admin/delCoupon','admin.Coupon/del');
        Route::rule('admin/chooseCoupon','admin.Coupon/choose');
    });

    //商城
    Route::group(function (){

        Route::rule('admin/getOrderList','cashier.Order/getOrderList');
        Route::rule('admin/getOrderDetail','cashier.Order/getOrderDetail');

        //商品分类
        Route::rule('admin/getGoodsCategoryList','admin.mall.GoodsCategory/index');
        Route::rule('admin/showGoodsCategory','admin.mall.GoodsCategory/show');
        Route::rule('admin/saveGoodsCategory','admin.mall.GoodsCategory/save');
        Route::rule('admin/delGoodsCategory','admin.mall.GoodsCategory/del');

        //商品管理
        Route::rule('admin/getGoodsList','admin.mall.Goods/index');
        Route::rule('admin/showGoods','admin.mall.Goods/show');
        Route::rule('admin/saveGoods','admin.mall.Goods/save');
        Route::rule('admin/undercarriageGoods','admin.mall.Goods/undercarriage');
        Route::rule('admin/groundingGoods','admin.mall.Goods/grounding');
        Route::rule('admin/chooseGoods','admin.mall.Goods/choose');

        //限时秒杀
        Route::rule('admin/getFlashSaleList','admin.mall.FlashSale/index');
        Route::rule('admin/showFlashSale','admin.mall.FlashSale/show');
        Route::rule('admin/saveFlashSale','admin.mall.FlashSale/save');
        Route::rule('admin/undercarriageFlashSale','admin.mall.FlashSale/undercarriage');
        Route::rule('admin/groundingFlashSale','admin.mall.FlashSale/grounding');

        //多人拼团
        //拼团商品
        Route::rule('admin/getPinTuanGoodsList','admin.mall.pintuan.Goods/index');
        Route::rule('admin/showPinTuanGoods','admin.mall.pintuan.Goods/show');
        Route::rule('admin/savePinTuanGoods','admin.mall.pintuan.Goods/save');
        Route::rule('admin/undercarriagePinTuanGoods','admin.mall.pintuan.Goods/undercarriage');
        Route::rule('admin/groundingPinTuanGoods','admin.mall.pintuan.Goods/grounding');
        //拼团管理
        Route::rule('admin/getGroupList','admin.mall.pintuan.Group/index');
        Route::rule('admin/getGroupMemberList','admin.mall.pintuan.Group/getGroupMemberList');
        Route::rule('admin/getGroupDetail','admin.mall.pintuan.Group/getGroupDetail');
        Route::rule('admin/toGroup','admin.mall.pintuan.Group/toGroup');

        //囤货管理
        //囤货商品
        Route::rule('admin/getStoreGoodsList','admin.mall.store.Goods/index');
        Route::rule('admin/showStoreGoods','admin.mall.store.Goods/show');
        Route::rule('admin/saveStoreGoods','admin.mall.store.Goods/save');
        Route::rule('admin/undercarriageStoreGoods','admin.mall.store.Goods/undercarriage');
        Route::rule('admin/groundingStoreGoods','admin.mall.store.Goods/grounding');
        //囤货订单
        Route::rule('admin/getStoreOrderList','admin.mall.store.Order/index');
        Route::rule('admin/getStoreOrderDetail','admin.mall.store.Order/detail');
        Route::rule('admin/writeOffStoreOrder','admin.mall.store.Order/writeOffStoreOrder');

        //订单管理
        Route::rule('admin/getGoodsOrderNum','admin.mall.Order/getGoodsOrderNum');
        Route::rule('admin/getGoodsOrderList','admin.mall.Order/index');
        Route::rule('admin/getGoodsOrderDetail','admin.mall.Order/detail');
        Route::rule('admin/deliverGoodsOrder','admin.mall.Order/deliverGoods');
        Route::rule('admin/writeOffOrder','admin.mall.Order/writeOff');
        Route::rule('admin/overGoodsOrder','admin.mall.Order/overGoods');

        //运费模板
        Route::rule('admin/showFreightTemplate','admin.mall.FreightTemplate/show');
        Route::rule('admin/saveFreightTemplate','admin.mall.FreightTemplate/save');

        //代客下单
        Route::rule('admin/getMemberWithMobileFromFakeOrder','admin.mall.FakeOrder/getMemberWithMobileFromFakeOrder');
        Route::rule('admin/getGoodsFromFakeOrder','admin.mall.FakeOrder/getGoodsFromFakeOrder');
        Route::rule('admin/getGoodsByIdsFromFakeOrder','admin.mall.FakeOrder/getGoodsByIdsFromFakeOrder');
        Route::rule('admin/getFreightFromFakeOrder','admin.mall.FakeOrder/getFreightFromFakeOrder');
        Route::rule('admin/createFakeOrder','admin.mall.FakeOrder/createFakeOrder');

        //商城统计
        Route::rule('admin/getMallStatisticsCount','admin.mall.Statistics/getMallStatisticsCount');
        Route::rule('admin/getMallStatisticsTakeCountRanking','admin.mall.Statistics/getMallStatisticsTakeCountRanking');
        Route::rule('admin/getMallStatisticsViewsRanking','admin.mall.Statistics/getMallStatisticsViewsRanking');
        Route::rule('admin/getMallStatisticsTrend','admin.mall.Statistics/getMallStatisticsTrend');
    });

    //相册
    Route::group(function (){
        Route::rule('admin/getLookList','admin.Look/index');
        Route::rule('admin/showLook','admin.Look/show');
        Route::rule('admin/saveLook','admin.Look/save');
        Route::rule('admin/delLook','admin.Look/del');
    });

    //合伙人
    Route::group(function (){
        //合伙人设置
        Route::rule('admin/showPartnerSetting','admin.partner.Setting/show');
        Route::rule('admin/savePartnerSetting','admin.partner.Setting/save');

        //合伙人
        Route::rule('admin/getPartnerList','admin.partner.Partner/index');
        Route::rule('admin/showPartner','admin.partner.Partner/show');
        Route::rule('admin/getPartnerDetail','admin.partner.Partner/detail');
        Route::rule('admin/savePartner','admin.partner.Partner/save');
        Route::rule('admin/delayPartner','admin.partner.Partner/delay');
        Route::rule('admin/withdrawalPartner','admin.partner.Partner/withdrawal');
        Route::rule('admin/delPartner','admin.partner.Partner/del');
        Route::rule('admin/getPartnerIncomeList','admin.partner.Partner/getPartnerIncomeList');
        Route::rule('admin/getPartnerCustomerList','admin.partner.Partner/getPartnerCustomerList');
        Route::rule('admin/bindMemberPartner','admin.partner.Partner/bindMember');
        Route::rule('admin/getPartnerDetailWithdrawList','admin.partner.Partner/getPartnerDetailWithdrawList');

        //提现记录
        Route::rule('admin/getPartnerWithdrawList','admin.partner.Withdraw/index');
        Route::rule('admin/agreePartnerWithdraw','admin.partner.Withdraw/agree');
        Route::rule('admin/withdrawSetting','admin.partner.Withdraw/withdrawSetting');
        Route::rule('admin/saveWithdrawSetting','admin.partner.Withdraw/saveWithdrawSetting');

    });

    //店铺设置
    Route::group(function (){
        // 门店设置
        Route::rule('admin/getStoreList','admin.setting.Store/getStoreList');
        Route::rule('admin/showStore','admin.setting.Store/showStore'); // 展示门店信息
        Route::rule('admin/saveStore','admin.setting.Store/saveStore'); // 保存门店信息
        Route::rule('admin/enableStore','admin.setting.Store/enableStore'); // 启用、禁用门店信息
        Route::rule('admin/deleteStore','admin.setting.Store/deleteStore'); // 删除门店信息
        Route::rule('admin/getSelectStoreList','admin.setting.Store/getSelectStoreList');
        
        //账号管理
        Route::rule('admin/getShopStaffList','admin.setting.ShopStaff/index');
        Route::rule('admin/showShopStaff','admin.setting.ShopStaff/show');
        Route::rule('admin/saveShopStaff','admin.setting.ShopStaff/save');
        Route::rule('admin/leaveShopStaff','admin.setting.ShopStaff/leave');
        Route::rule('admin/chooseShopStaff','admin.setting.ShopStaff/choose');
        Route::rule('admin/quitShopStaff','admin.setting.ShopStaff/quit'); // 技师离职
        Route::rule('admin/delShopStaff','admin.setting.ShopStaff/del'); // 删除技师
        
        //短信设置
        Route::rule('admin/showSmsSetting','admin.setting.Sms/show');
        Route::rule('admin/saveSmsSetting','admin.setting.Sms/save');
        Route::rule('admin/getSmsPackage','admin.setting.Sms/getSmsPackage');
        Route::rule('admin/getRechargeLogs','admin.setting.Sms/getRechargeLogs');
        Route::rule('admin/getSmsSendLogs','admin.setting.Sms/getSmsSendLogs');
        
        //积分设置
        Route::rule('admin/showIntegralSetting','admin.setting.Integral/show');
        Route::rule('admin/saveIntegralSetting','admin.setting.Integral/save');

        //余额设置
        Route::rule('admin/showBalanceSetting','admin.setting.Balance/show');
        Route::rule('admin/saveBalanceSetting','admin.setting.Balance/save');

        //买单设置
        Route::rule('admin/showBuySetting','admin.setting.Buy/show');
        Route::rule('admin/saveBuySetting','admin.setting.Buy/save');

        //打印机设置
        Route::rule('admin/showPrinterSetting','admin.setting.Printer/showPrinterSetting');
        Route::rule('admin/savePrinterSetting','admin.setting.Printer/savePrinterSetting');
        Route::rule('admin/getPrinterList','admin.setting.Printer/getPrinterList');
        Route::rule('admin/showPrinter','admin.setting.Printer/showPrinter');
        Route::rule('admin/bindYlyPrinter','admin.setting.Printer/bindYlyPrinter');
        Route::rule('admin/bindFeiePrinter','admin.setting.Printer/bindFeiePrinter');
    });

    //小程序
    Route::group(function (){
        //推荐小程序
        Route::rule('admin/getRecommendAppList','admin.miniapp.Recommend/index');
        Route::rule('admin/showRecommendApp','admin.miniapp.Recommend/show');
        Route::rule('admin/saveRecommendApp','admin.miniapp.Recommend/save');
        Route::rule('admin/delRecommendApp','admin.miniapp.Recommend/del');
        //主题设置
        Route::rule('admin/getStyle','admin.miniapp.Template/getStyle');
        Route::rule('admin/saveStyle','admin.miniapp.Template/saveStyle');
    });


})->middleware([\app\beautiful\middleware\Base::class,\app\beautiful\middleware\AdminCheck::class]);
